package Homework.Homework04;

import java.util.ArrayList;
import java.util.List;

public class PrintStudent {
    List<Student> list = new ArrayList<>();
    public static void printStudent(List<Student> list) {
        if (list.size() == 0) {
            System.out.println("打印失败，没有学生信息，请先添加学生信息。");
            return;
        }
        for (int i = 0; i < list.size(); i++) {
            Student s = list.get(i);
            System.out.println("学号：" + s.getID() + "\t" + "姓名：" + s.getName() + "\t" + "年龄：" + s.getAge());
        }
    }
}
